import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/Home.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect:"/login"
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/Index.vue')
  },
  {
    path: '/home',
    name: 'home',
    redirect:'/home/index',
    component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
    meta:{
      title:"首页"
    },
    children:[
      // 首页
      {
        path: '/home/index',
        name: '展示首页',
        component: () => import(/* webpackChunkName: "index" */ '../views/homeChildren/MyIndex.vue'),
        meta:{
          title:"首页"
        },
      },
      // 人员管理
      {
        path: '/home/peopleManage',
        name: '人员管理',
        redirect:'/home/peopleManage/merchantsManage',
        component: () => import(/* webpackChunkName: "人员管理" */ '../views/homeChildren/PeopleManage.vue'),
        meta:{
          title:"人员管理"
        },
        children:[
          // 用户/coser管理
          {
            path: '/home/peopleManage/userManage',
            name: '用户/coser管理',
            component: () => import(/* webpackChunkName: "用户/coser管理" */ '../views/homeChildren/UsersManage.vue'),
            meta:{
              title:"用户/coser管理",
              classifyTitle:"用户/coser管理" //分类标题
            }
          },
          // 商家管理
          {
            path: '/home/peopleManage/merchantsManage',
            name: '商家管理',
            component: () => import(/* webpackChunkName: "商家管理" */ '../views/homeChildren/MerchantsManage.vue'),
            meta:{
              title:"商家管理",
              classifyTitle:"商家管理" //分类标题
            }
          },
          // 内勤人员管理
          {
            path: '/home/peopleManage/officialsManage',
            name: '内勤人员管理',
            component: () => import(/* webpackChunkName: "内勤人员管理" */ '../views/homeChildren/OfficialsManage.vue'),
            meta:{
              title:"内勤人员管理",
              classifyTitle:"内勤人员管理" //分类标题
            }
          },
        ]
      },
      
      // 场地管理
      {
        path: '/home/SiteManage',
        name: '场地管理',
        component: () => import(/* webpackChunkName: "场地管理" */ '../views/homeChildren/SiteManage.vue'),
        meta:{
          title:"场地管理"
        }
      },
      // 财务管理
      {
        path: '/home/financeManage',
        name: '财务管理',
        component: () => import(/* webpackChunkName: "财务管理" */ '../views/homeChildren/FinanceManage.vue'),
        meta:{
          title:"财务管理"
        }
      },
      // 入驻审核
      // {
      //   path: '/home/incheck',
      //   name: '入驻审核',
      //   component: () => import(/* webpackChunkName: "入驻审核" */ '../views/homeChildren/InCheck.vue'),
      //   meta:{
      //     title:"入驻审核"
      //   }
      // },
      // 设置
      {
        path: '/home/setting',
        name: '设置',
        component: () => import(/* webpackChunkName: "设置" */ '../views/homeChildren/MySetting.vue'),
        meta:{
          title:"设置"
        }
      },
    ]
  },
  

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
